from django import template
from bvsearchapp.BeautifulSoup import BeautifulSoup
from django.conf import settings
register = template.Library()

@register.filter
def pretty_html(value):
    html = value.replace('a href="/', 'a href="/%s' % settings.SITE_URL)
    soup = BeautifulSoup(html)
    return soup.prettify()

pretty_html.is_safe = True
